<template>
  <div>
    <!--<el-button @click="新增"></el-button>-->
    <h1>excel导入记录</h1>
    <el-card>
      <el-table
        :data="tableData"
        border
        style="width: 100%">
        <el-table-column
          prop="excelossId"
          label="id"
          width="180">
        </el-table-column>
        <el-table-column
          prop="excelossName"
          label="文件名字"
          width="180">
        </el-table-column>
        <el-table-column
          prop="excelossChaining"
          label="文件信息"
          width="180">
          <template slot-scope="scope">
            <a :href="scope.row.excelossChaining">查看</a>
          </template>
        </el-table-column>
        <el-table-column
          label="操作">
          <template slot-scope="scope">
            <el-button @click="excelossDelete(scope.row.excelossId)">删除</el-button>
            <el-button @click="excelossUpdates(scope.row.excelossId)">修改</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        width="30%"
        :before-close="handleClose">
        <el-form>
          <el-form-item label="修改以后的名字">
            <el-input v-model="tbexceloss.excelossName"></el-input>
          </el-form-item>
        </el-form>
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="excelossUpdate()">确 定</el-button>
      </el-dialog>
    </el-card>
  </div>
</template>
<script>
  import {excelossSelect,excelossUpdate,excelossDelete} from '@/api/evaluating'
  export default {
    name: 'Index',
    data(){
      return {
        dialogVisible: false,
        tableData:[],
        tbexceloss:{
          excelossId:'',
          excelossName:'',
        }
      }
    },
    mounted(){
      this.excelossSelect()
    },
    methods:{
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      },
      excelossSelect(){
        excelossSelect(this.tbexceloss).then((res)=>{
          console.log(res.data)
          this.tableData=res.data
        })
      },
      excelossUpdate(){
        excelossUpdate(this.tbexceloss).then((res)=>{
          console.log(res.data)
          this.dialogVisible=false
          this.tbexceloss=[]
          this.excelossSelect()
        })
      },
      excelossUpdates(row){
        this.dialogVisible=true
        this.tbexceloss.excelossId=row
      },
      excelossDelete(row){
        excelossDelete(row).then((res)=>{
          console.log(res.data)
          this.excelossSelect()
        })
      }
    }
  }
</script>
<style>

</style>
